home *** CD-ROM | disk | FTP | other *** search
- {$M 17000,0,0}
- program caddy; {release 2.4 by Michael Taylor}
- uses Crt, Dos;
-
- const
- F1: boolean = false;
- SPACEHIT: boolean = false;
- F1KEY = $3B;
- SPACEKEY = $39;
-
- var
- ScreenBuf: array[1..16384] of byte;
- OldInt9: pointer;
- Window: boolean;
- ProgName: string[12];
- CmdParm: string[40];
- count: byte;
-
- procedure GolfHelpProc(flags,CS,IP,AX,BX,CX,DX,SI,DI,DS,ES,BP:word);
- Interrupt;
- var
- counter: word;
- MemPtr: integer;
-
- begin
-
- Inline(
- {; *** getkey.asm - get key pressed}
- $FB/ { sti ; allow int}
- $9C/ { pushf}
- $C6/$06/>F1/$00/ { mov byte ptr [>F1],+$00 ;set F1 to false}
- $C6/$06/>SPACEHIT/$00/ { mov byte ptr [>SPACEHIT],+$00 ;set SPACEHIT to false}
- $E4/$60/ { in al,$60 ;read keyboard port}
- $3C/<F1KEY/ { cmp al,<F1KEY ;compare to F1}
- $75/$08/ { jne schk ;jump if false}
- $C6/$06/>F1/$01/ { mov byte ptr [>F1],+$01 ;set F1 to true}
- $E9/$09/$00/ { jmp next}
- $3C/<SPACEKEY/ {schk: cmp al,<SPACEKEY ;check for space key}
- $75/$05/ { jne next}
- $C6/$06/>SPACEHIT/$01/ { mov byte ptr [>SPACEHIT],+$01 ;set to true if space hit}
- $90); {next: nop}
-
- if (F1) and (Window = false) then
- begin
- Window := true;
- MemPtr:= $0000;
- for counter := 1 to 16384 do
- begin
- ScreenBuf[counter] := Mem[$B800:MemPtr];
- MemPtr := MemPtr + 1;
- end {for};
- GotoXY(6,1);
- write('Online Caddy by Michael Taylor ');
- GotoXY(6,2);
- write(' ');
- GotoXY(6,3);
- write(' Full Short Dotted ');
- GotoXY(6,4);
- write(' ');
- GotoXY(6,5);
- write('Driver 270 250 143 ');
- GotoXY(6,6);
- write('3 Wood 252 229 131 ');
- GotoXY(6,7);
- write('4 Wood 238 216 116 ');
- GotoXY(6,8);
- write('2 Iron 224 207 109 ');
- GotoXY(6,9);
- write('3 Iron 214 197 105 ');
- GotoXY(6,10);
- write('4 Iron 199 185 96 ');
- GotoXY(6,11);
- write('5 Iron 188 172 91 ');
- GotoXY(6,12);
- write('6 Iron 173 158 82 ');
- GotoXY(6,13);
- write('7 Iron 162 148 74 ');
- GotoXY(6,14);
- write('8 Iron 148 136 69 ');
- GotoXY(6,15);
- write('9 Iron 137 125 56 ');
- GotoXY(6,16);
- write('P Wedge 121 111 50 ');
- GotoXY(6,17);
- write(' ');
- GotoXY(6,18);
- write('Press SpaceBar to continue ');
-
- Inline(
- $E4/$61/ {Get: IN AL,$61 ;Read Kbd Controller Port}
- $88/$C4/ { MOV AH,AL}
- $0C/$80/ { OR AL,$80 ;Set reset bit}
- $E6/$61/ { OUT $61,AL ; send back to control}
- $86/$C4/ { XCHG AH,AL ;Get back control value}
- $E6/$61/ { OUT $61,AL ; and send it back}
- $9D/ { POPF ;restore flags}
- $FA/ { CLI ;No interrupts}
- $B0/$20/ { MOV AL,+$20 ;Send EOI to the}
- $E6/$20) { OUT $20,AL ; interrupt controller}
- end
- else
- if Window then
- begin
- if SPACEHIT then
- begin
- Window := false;
- MemPtr := $0000;
- for counter := 1 to 16384 do
- begin
- Mem[$B800: MemPtr] := ScreenBuf[counter];
- MemPtr := MemPtr + 1;
- end {for};
- end {if};
-
- Inline(
- $E4/$61/ {Get: IN AL,$61 ;Read Kbd Controller Port}
- $88/$C4/ { MOV AH,AL}
- $0C/$80/ { OR AL,$80 ;Set reset bit}
- $E6/$61/ { OUT $61,AL ; send back to control}
- $86/$C4/ { XCHG AH,AL ;Get back control value}
- $E6/$61/ { OUT $61,AL ; and send it back}
- $9D/ { POPF ;restore flags}
- $FA/ { CLI ;No interrupts}
- $B0/$20/ { MOV AL,+$20 ;Send EOI to the}
- $E6/$20) { OUT $20,AL ; interrupt controller}
- end
- else
-
- Inline(
- $9D/ { POPF}
- $A1/>OLDINT9+2/ { MOV AX,[>OLDINT9+2]}
- $8B/$1E/>OLDINT9/ { MOV BX,[>OLDINT9]}
- $87/$5E/$0E/ { XCHG BX,[BP+$0E]}
- $87/$46/$10/ { XCHG AX,[BP+$10]}
- $89/$EC/ { MOV SP,BP}
- $5D/ { POP BP}
- $07/ { POP ES}
- $1F/ { POP DS}
- $5F/ { POP DI}
- $5E/ { POP SI}
- $5A/ { POP DX}
- $59/ { POP CX}
- $CB); { RETF}
-
- end {procedure};
-
- Begin
- {check for alternate exe file}
- if ParamCount > 0 then
- begin
- ProgName := ParamStr(1);
- if (pos('.com',ProgName) = 0)
- and (pos('.COM',ProgName) = 0)
- then
- ProgName := ProgName + '.exe';
- end
- else
- ProgName := 'golf.exe';
-
- {check for command line parameters}
- CmdParm := '';
- if ParamCount > 1 then
- for count := 2 to ParamCount do
- CmdParm := CmdParm + ' ' + ParamStr(count);
-
- {display message}
- DirectVideo := false;
- GetIntVec(9, OldInt9);
- SetIntVec(9, @GolfHelpProc);
- writeln(' Online Caddy');
- writeln(' ver 2.4 ');
- writeln(' by ');
- writeln(' Michael Taylor');
- writeln(' ');
- writeln('During Golf Game, press F1 to activate Caddy');
- Window := false;
- Exec(ProgName,CmdParm);
- SetIntVec(9, OldInt9);
- End.